import {connect} from "react-redux";
import Chosen from "../pages/Chosen";

//引入action函数
import {getAllType} from "../actions";

//1.映射state
const mapStateToProps=(state)=>{
    return{
        foo:state.chosen.foo,
        allType:state.chosen.all
    }
}


//2.映射dispatch
const mapDispatchToProps=(dispatch)=>{
    return{
      //获取所有分裂
      getAllType(){
          dispatch(getAllType())
      }
    }
}

//高阶组件处理以上两个函数

let chosenContainer= connect(mapStateToProps,mapDispatchToProps)(Chosen);

export default chosenContainer;